﻿using System.Windows.Forms;

partial class TeradataConnectionStringEditor : UserControl
{
    public TeradataConnectionStringEditor()
    {
        InitializeComponent();
    }

    public TeradataConnectionStringEditor(string connectionString)
    {
        InitializeComponent();

        TeradataConnectionStringBuilder builder = new TeradataConnectionStringBuilder(connectionString);

        tbServer.Text = builder.Source;
        tbUid.Text = builder.ID;
        tbPwd.Text = builder.Password;
    }

    public override string ToString()
    {
        // http://www.connectionstrings.com/teradata
        return string.Format("Data Source={0};User ID={1};Password={2};",
            tbServer.Text,
            tbUid.Text,
            tbPwd.Text);
    }
}
